import { useRoutes } from "react-router-dom";
import { routes } from "./routes";
import { RouteItem } from "./interface/route-item.interface";
import LoginComponent from "../views/login";
import NotFound from "../views/exception/not-found";


const rootRouter: RouteItem[] = [
	{
		path: '/login',
		element: <LoginComponent />
	},
	...routes,
	{
		path: '*',
		element: <NotFound />,
	}
]

/**
 * 路由
 * @returns 
 */
const Router = () => {
	const routes = useRoutes(rootRouter);
	return routes;
};

export default Router;
